//
//  CHDBaseVC.m
//  IOSWeiiPhoneNews
//
//  Created by ibokan on 14-4-23.
//  Copyright (c) 2014年 chen. All rights reserved.
//

#import "CHDBaseVC.h"
#import "MBProgressHUD.h"
#define RGBCOLOR(r,g,b) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:1]
@interface CHDBaseVC ()<MBProgressHUDDelegate>
{
   MBProgressHUD *HUD;
}
@end

@implementation CHDBaseVC

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    //设置背景颜色为白色
    self.view.backgroundColor = [UIColor whiteColor];
//    //刷新bar
//    UIBarButtonItem *leftBtn = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(refreshAction)];
//    self.navigationItem.leftBarButtonItem = leftBtn;
}
-(void)showHUD{
    HUD = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
    HUD.delegate = self;
    HUD.animationType = MBProgressHUDAnimationZoom;
    HUD.labelText = @"加载中...";
    HUD.color =RGBCOLOR(45, 122, 180);
    [HUD show:YES];
}
-(void)hideHUD{
    [HUD hide:YES];
}


-(void)refreshAction{
    
}
#pragma mark -
#pragma mark MBProgressHUDDelegate methods
//实现协议的代理方法
- (void)hudWasHidden:(MBProgressHUD *)hud {
	// Remove HUD from screen when the HUD was hidded
	[hud removeFromSuperview];
	hud = nil;
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
